﻿
namespace DiagnosticCenter.Web
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Data.Objects.DataClasses;
    using System.Linq;
    using System.ServiceModel.DomainServices.Hosting;
    using System.ServiceModel.DomainServices.Server;


    #region tblAnswer
    [MetadataTypeAttribute(typeof(tblAnswer.tblAnswerMetadata))]
    public partial class tblAnswer
    {
        internal sealed class tblAnswerMetadata
        {
            private tblAnswerMetadata() {}

            public int AnswerID { get; set; }
            public int QuestionID { get; set; }
            public string Text { get; set; }
            public Nullable<bool> IsTrue { get; set; }
            public Nullable<int> AnswerNum { get; set; }
            public Nullable<int> RowNum { get; set; }

            [Include]
            public tblQuestion tblQuestion { get; set; }
        }
    }
    #endregion

    #region tblGroup
    [MetadataTypeAttribute(typeof(tblGroup.tblGroupMetadata))]
    public partial class tblGroup
    {
        internal sealed class tblGroupMetadata
        {
            private tblGroupMetadata() {}

            public int GroupID { get; set; }
            public string Name { get; set; }
            public string Speciality { get; set; }
            public Nullable<int> Course { get; set; }
            public string StudyKind { get; set; }
            public string StartYear { get; set; }
            public int CuratorID { get; set; }
            public int LeaderID { get; set; }
            
            public EntityCollection<tblTestSchedule> tblTestSchedules { get; set; }
            public EntityCollection<tblUser> tblUsers { get; set; }
        }
    }
    #endregion

    #region tblQuestion
    [MetadataTypeAttribute(typeof(tblQuestion.tblQuestionMetadata))]
    public partial class tblQuestion
    {
        internal sealed class tblQuestionMetadata
        {
            private tblQuestionMetadata() {}

            public int QuestionID { get; set; }
            public int TestID { get; set; }
            public string Text { get; set; }
            public Nullable<int> TextType { get; set; }
            public Nullable<int> AnswerType { get; set; }
            public Nullable<int> Difficulty { get; set; }
            public string AnswerLite { get; set; }
            public bool AnswerImage { get; set; }

            public tblTest tblTest { get; set; }
            [Include]
            public EntityCollection<tblAnswer> tblAnswers { get; set; }
            public EntityCollection<tblResultItem> tblResultItems { get; set; }
        }
    }
    #endregion

    #region tblResult
    [MetadataTypeAttribute(typeof(tblResult.tblResultMetadata))]
    public partial class tblResult
    {
        internal sealed class tblResultMetadata
        {
            private tblResultMetadata() {}

            public int ResultID { get; set; }
            public int TestID { get; set; }
            public int UserID { get; set; }
            public Nullable<DateTime> DateStart { get; set; }
            public Nullable<DateTime> DateFinish { get; set; }
            public Nullable<int> Rating { get; set; }
            public Nullable<int> RightAnswers { get; set; }

            [Include]
            public tblTest tblTest { get; set; }
            [Include]
            public tblUser tblUser { get; set; }
            [Include]
            public EntityCollection<tblResultItem> tblResultItems { get; set; }
        }
    }
    #endregion

    #region tblResultItem
    [MetadataTypeAttribute(typeof(tblResultItem.tblResultItemMetadata))]
    public partial class tblResultItem
    {
        internal sealed class tblResultItemMetadata
        {
            private tblResultItemMetadata() {}

            public int ResultItemID { get; set; }
            public int ResultID { get; set; }
            public int QuestionID { get; set; }
            public Nullable<bool> IsRight { get; set; }
            public string ResultText { get; set; }

            [Include]
            public tblResult tblResult { get; set; }
            [Include]
            public tblQuestion tblQuestion { get; set; }
        }
    }
    #endregion

    #region tblSubject
    [MetadataTypeAttribute(typeof(tblSubject.tblSubjectMetadata))]
    public partial class tblSubject
    {
        internal sealed class tblSubjectMetadata
        {
            private tblSubjectMetadata() {}

            public int SubjectID { get; set; }
            public string FullName { get; set; }
            public string ShortName { get; set; }
         
            public EntityCollection<tblTest> tblTests { get; set; }
        }
    }
    #endregion

    #region tblTest
    [MetadataTypeAttribute(typeof(tblTest.tblTestMetadata))]
    public partial class tblTest
    {
        internal sealed class tblTestMetadata
        {
            private tblTestMetadata() {}

            public int TestID { get; set; }
            public int SubjectID { get; set; }
            public string TestName { get; set; }
            public Nullable<int> TotalTime { get; set; }
            public Nullable<int> TestMode { get; set; }
            public Nullable<int> TestRating { get; set; }
            public Nullable<int> QuestionCount { get; set; }
            public Nullable<int> QuestionResult { get; set; }
            public bool TestRules { get; set; }
            public bool AllowRefuse { get; set; }
            public bool AllowTips { get; set; }
            public bool ResultPrint { get; set; }
            public bool ResultSave { get; set; }
            public bool ResultShow { get; set; }
            public bool ShuffleAnswers { get; set; }
            public bool ShuffleQuestions { get; set; }

            [Include]
            public tblSubject tblSubject { get; set; }
            [Include]
            public EntityCollection<tblQuestion> tblQuestions { get; set; }
            public EntityCollection<tblResult> tblResults { get; set; }
            public EntityCollection<tblTestSchedule> tblTestSchedules { get; set; }
        }
    }
    #endregion

    #region tblTestSchedule
    [MetadataTypeAttribute(typeof(tblTestSchedule.tblTestScheduleMetadata))]
    public partial class tblTestSchedule
    {
        internal sealed class tblTestScheduleMetadata
        {
            private tblTestScheduleMetadata() {}

            public int ID { get; set; }
            public int GroupID { get; set; }
            public int TestID { get; set; }
            public Nullable<DateTime> DateStart { get; set; }

            [Include]
            public tblGroup tblGroup { get; set; }
            [Include]
            public tblTest tblTest { get; set; }
        }
    }
    #endregion

    #region tblUser
    [MetadataTypeAttribute(typeof(tblUser.tblUserMetadata))]
    public partial class tblUser
    {
        internal sealed class tblUserMetadata
        {
            private tblUserMetadata() {}

            public int UserID { get; set; }
            public string Login { get; set; }
            public string Password { get; set; }
            public string Email { get; set; }
            public int Role { get; set; }
            public string LastName { get; set; }
            public string FirstName { get; set; }
            public string MiddleName { get; set; }
            public Nullable<int> Sex { get; set; }
            public Nullable<DateTime> Birthdate { get; set; }
            public string Phone { get; set; }
            public string City { get; set; }
            public string Address { get; set; }
            public Nullable<int> GroupID { get; set; }
            public string ChairName { get; set; }
            public string DigreeName { get; set; }
            public string Appointment { get; set; }
            public Nullable<int> AverageRating { get; set; }
            public Nullable<int> PsyxMotivation { get; set; }
            public Nullable<int> PsyxTemperament { get; set; }
            public Nullable<int> PsyxSociality { get; set; }
            public Nullable<int> Payment { get; set; }

            //Аутентификация; удалить
            public string Name { get; set; }
            public IEnumerable<string> Roles { get; set; }

            [Include]
            public tblGroup tblGroup { get; set; }
            public EntityCollection<tblResult> tblResults { get; set; }
        }
    }
    #endregion
}
